package com.slz3.business.module.messageManagement.mesTemplate.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.messageManagement.mesTemplate.domain.MesTemplate;
import com.slz3.business.module.messageManagement.mesTemplate.domain.MesTemplateCondition;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

@Component
public class MesTemplateResAtomic {

    public Mono<ServerResponse> add_$MesTemplateUpdateLock(ServerRequest req, MesTemplate mesTemplate) {
        return MesTemplateResSafeValid.add(req, mesTemplate) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesTemplateResExecutor.add(req, mesTemplate);
    }

    public Mono<ServerResponse> delete_$MesTemplateUpdateLock(ServerRequest req, MesTemplateCondition mesTemplateCondition) {
        return MesTemplateResSafeValid.delete(req, mesTemplateCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesTemplateResExecutor.delete(req);
    }

    public Mono<ServerResponse> modify_$MesTemplateUpdateLock(ServerRequest req, MesTemplate mesTemplate) {
        return MesTemplateResSafeValid.modify(req, mesTemplate) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesTemplateResExecutor.modify(req, mesTemplate);
    }

    public Mono<ServerResponse> info_$MesTemplateUpdateLock(ServerRequest req) {
        return MesTemplateResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesTemplateResExecutor.info(req);
    }

    public Mono<ServerResponse> auditSubmit_$MesTemplateUpdateLock(ServerRequest req, MesTemplateCondition mesTemplateCondition) {
        return MesTemplateResSafeValid.auditSubmit(req, mesTemplateCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesTemplateResExecutor.auditSubmit(req);
    }

    public Mono<ServerResponse> audit_$MesTemplateUpdateLock(ServerRequest req, MesTemplateCondition mesTemplateCondition) {
        return MesTemplateResSafeValid.audit(req, mesTemplateCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesTemplateResExecutor.audit(req);
    }

    public Mono<ServerResponse> auditReject_$MesTemplateUpdateLock(ServerRequest req, MesTemplateCondition mesTemplateCondition) {
        return MesTemplateResSafeValid.auditReject(req, mesTemplateCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesTemplateResExecutor.auditReject(req);
    }


    public Mono<ServerResponse> usingEnable_$MesTemplateUpdateLock(ServerRequest req, MesTemplateCondition mesTemplateCondition) {
        return MesTemplateResSafeValid.usingEnable(req, mesTemplateCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesTemplateResExecutor.usingEnable(req);
    }

    public Mono<ServerResponse> usingDisable_$MesTemplateUpdateLock(ServerRequest req, MesTemplateCondition mesTemplateCondition) {
        return MesTemplateResSafeValid.usingDisable(req, mesTemplateCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesTemplateResExecutor.usingDisable(req);
    }
}
